import 'package:flutter/material.dart';

//// Simple app test
class UpdateTextDemoApp extends StatelessWidget {
	@override
	Widget build(BuildContext context) {
		// TODO: implement build
		return MaterialApp(
			title: "Simple App",
			theme: new ThemeData(
				primarySwatch: Colors.blue,
			),
			home: UpdateTextDemo(),
		);
	}
}

class UpdateTextDemo extends StatefulWidget {
	UpdateTextDemo({Key key}) : super(key: key);

	@override
	_UpdateTextDemoState createState() => _UpdateTextDemoState();
}

class _UpdateTextDemoState extends State<UpdateTextDemo> {
	// Default placeholder text
	String textToShow = "I Like Flutter";

	void _updateText() {
		setState(() {
			// update the text
			textToShow = "Flutter is Awesome AA!";
		});
	}

	@override
	Widget build(BuildContext context) {
		return Scaffold(
			appBar: AppBar(
				title: Text("Sample App"),
			),
			body: Center(
				child: Opacity(
					opacity: 0.3,
					child: Text(textToShow))
			),
			floatingActionButton: FloatingActionButton(
				onPressed: _updateText,
				tooltip: 'Update Text',
				child: Icon(Icons.update),
			),
		);
	}
}
